<?php
	$loi = "";
	if(isset($_POST["ok"])){
		$h = "";
		if($_POST["tenhang"] == null){
			$loi[] = "Ban chua nhap hang";
		}else{
			$h = $_POST["tenhang"];
		}
		if($h){
			$addhang = new mhangxe();
			$addhang->sethang($h);
			if($addhang->kiemtra() == true){
				$addhang->insert();
				header("location:index.php?module=hang&action=list");
				exit();				
			}else{
				$loi[] = "Ten hang da co";
			}
		}
	}
?>
<?php
	require ("views/hangxe/vadd_hangxe.php");
?>